//package com.hzsai.config;
//
//import com.alibaba.fastjson.JSON;
//import com.alibaba.fastjson.JSONWriter;
//import com.alibaba.fastjson.support.hsf.HSFJSONUtils;
//import com.hzsai.utils.ResponseMsg;
//import org.springframework.security.core.AuthenticationException;
//import org.springframework.security.web.AuthenticationEntryPoint;
//import org.springframework.stereotype.Component;
//
//import javax.servlet.ServletException;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//
///**
// * hzsai 2019/8/3
// * usage:
// **/
//@Component
//public class MyAuthenticationEntryPoint implements AuthenticationEntryPoint {
//    @Override
//    public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) throws IOException, ServletException {
//        response.setCharacterEncoding("UTF-8");
//        response.setContentType("application/json");
//        response.getWriter().println(JSON.toJSON(ResponseMsg.fail(400, "AE: 什么，都9012年了你还没登录吗w(ﾟДﾟ)w" , e.getMessage())));
//        response.getWriter().flush();
//    }
//}
